﻿using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Text;

namespace ST.Common.Util.Cache
{
	public class RedisCacheManager : ICacheManager
	{
		private readonly IDatabase db;

		public RedisCacheManager()
		{

		}
		/// <summary>
		/// 从缓存中读取，如果读取不到调用获取函数获取然后存入缓存
		/// </summary>
		/// <typeparam name="T">Type of cached item</typeparam>
		/// <param name="key">Cache key</param>
		/// <param name="acquire">Function to load item if it's not in the cache yet</param>
		/// <param name="cacheTime">缓存时间（秒），如果传0则不缓存</param>
		/// <returns>The cached value associated with the specified key</returns>
		public T Get<T>(string key, Func<T> acquire, int cacheSeconds)
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// 添加或更新数据到指定缓存
		/// </summary>
		/// <param name="key">缓存Key</param>
		/// <param name="data">缓存数据</param>
		/// <param name="cacheTime">缓存时间（秒）</param>
		public void Set(string key, object data, int cacheSeconds)
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// 判断指定缓存Key是否存在
		/// </summary>
		/// <param name="key">缓存Key</param>
		/// <returns>True if item already is in cache; otherwise false</returns>
		public bool IsSet(string key)
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// 移除指定缓存
		/// </summary>
		/// <param name="key">缓存Key</param>
		public void Remove(string key)
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Removes items by key pattern
		/// </summary>
		/// <param name="pattern">String key pattern</param>
		public void RemoveByPattern(string pattern)
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// 清除所有缓存
		/// </summary>
		public void Clear()
		{
			throw new NotImplementedException();
		}

		public void Dispose()
		{
		}
	}
}
